<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>边框</title>
    <style>
        /* 
        简写形式:
        margin: 0 auto;

        */
        .outer {
            width: 100%;
            height: 200px;
            color: white;
            background-color: blue;
        }

        .inner {
            width: 100px;
            height: 200px;
            /* 复杂的写法: */
            margin-left: auto;
            margin-right: auto;
            color: white;
            background-color: red;
        }
    </style>
</head>

<body>
    <h2>水平居中</h2>
    设置确定的值，然后两边auto
    <p>
        margin-left: auto;

    </p>
    <p>margin-right: auto;</p>
    <hr>
    <div class="outer">
        <div class="inner"></div>
    </div>
</body>

</html>